<header data-am-widget="header" class="am-header am-header-default sq-head ">
	<div class="am-header-left am-header-nav">
		<a href="javascript:history.back()" class="">
			<i class="am-icon-chevron-left"></i>
		</a>
	</div>
	<h1 class="am-header-title">
		<a href="" class="">修改密码</a>
	</h1>
</header>
<div style="height: 49px;"></div>
<form action="" class="layui-form" >
	<input type="password" name="password" placeholder="旧密码" class="login-password">
	<input type="password" name="newpassword" placeholder="新密码" class="login-name">
	<input type="password" name="renewpassword" placeholder="确认新密码" class="login-password">
	<button class="login-btn" lay-submit lay-filter="sure" >确认</button>
</form>
<script>
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(sure)', function(data){
            $.post("{:url('index/SafetySet/editPassword')}", data.field, function(res) {
                if (res.code==1){
                    layer.alert(res.msg, {icon: 1},function (){
                        location.href=("{:url('index/Login/index')}");
                    });
                }else{
                    layer.msg(res.msg, {icon: 9},function () {
                    });
                }
            });
            return false;
        });
    });
</script>